// Copyright (C) 2012 Tanmay Sinha
// All rights reserved

package org.saakshar.utils;

import android.content.Context;
import android.graphics.Typeface;

/**
 * 
 * Utility for handling fonts
 * 
 * @author tanmay
 * 
 */
public final class FontUtils {

	public static Typeface loadFont(Context context, String pathToFile) {
		Typeface typeface;

		try {
			typeface = Typeface
					.createFromAsset(context.getAssets(), pathToFile);
		} catch (Exception e) {
			// Do nothing if failed to load the font
			typeface = null;
		}

		return typeface;
	}

}
